<div id="galerie_corp">
    <div class="gallery_root_var">
    <?php
            $data = mysql_query("select * from dt_offers where o_id = '".$_GET['pid']."'");
            while ($row = mysql_fetch_array($data)){
                    if ($row['head_type'] == 'picture'){
                        $photos = mysql_query("select * from dt_offers_photos where o_id = '".$row['o_id']."' order by `oImg_id` desc limit 1");
                        $pRow = mysql_fetch_array($photos);
                        echo '<div>';
                        echo '<div style="z-index: 2;">';
                        echo '<a class="lightbox" style="z-index:2; position: absolute; width: 620px; height: 285px;overflow:hidden" href="../../../uploads/offers/img/'.cleanitup($row['o_title']).'/'.'thumbs/thumb-620_'.$pRow['oImg_file'].'">';
                        echo '<img src="../../../uploads/offers/img/'.cleanitup($row['o_title']).'/'.'thumbs/thumb-620_'.$pRow['oImg_file'].'" width="620" /></a>';
                        //echo resizeImg('uploads/offers/img/'.cleanitup($row['o_title']).'/'.'thumbs/thumb-620_'.$pRow['oImg_file'],620,285,0).'</a>';
                        echo '</div>';

                        echo'<a class="lightbox" href="../../../uploads/offers/img/'.cleanitup($row['o_title']).'/'.$pRow['oImg_file'].'">';
                        echo '<div class="gallery_picture_text_ctg">'.$row['o_title'].' '.$row['o_label'].'</div>';
                        echo'</a>';
                    }
                    elseif ($row['head_type'] == 'gallery'){
                        $photos = mysql_query("select * from dt_offers_photos where o_id = '".$_GET['pid']."'");

                        $i = 0;
                        $x = 0;
                        echo '<div class="gallery_root_var">';
                        echo '<div class="gallery_picture_holder_var">';
                        //<!-- imaginile mari -->
                        echo '<div id="pozaMare" style="overflow:hidden; height:285px; width:620px;float:left;">';
                        while ($pRow = mysql_fetch_array($photos)){
                            echo '<div id="poza'.$i.'">';
                            echo '<a class="lightbox" href="../../../uploads/offers/img/'.cleanitup($row['o_title']).'/'.$pRow['oImg_file'].'">';
                            echo '<img src="../../../uploads/offers/img/'.cleanitup($row['o_title']).'/'.'thumbs/thumb-620_'.$pRow['oImg_file'].'" width="620">';
                            echo '</a>';
                            echo '</div>';
                            $i++;
                        }
                        //<!-- end imaginile mari -->
                        echo '</div>';
                        echo '<div class="gallery_picture_text_var">';
                        //<!-- text imagini -->
                        //nu este nevoie -- echo '<div><img src="../../../templates/default/images/transparent.gif" width="111" height="95"></div><div>Thailanda</div><div class="gallery_picture_subtext">de la&nbsp;<b>1200 euro</b>&nbsp;de persoana</div>';
                        //<!-- end text imagini -->
                        echo '</div>';
                        echo '<div class="gallery_slider_holder_var">';
                        //<!-- thumbs slider -->
                        echo '<div id="thumb" style="float:right;">';
                        echo '<ul id="scroller">';

                        $photos = mysql_query("select * from dt_offers_photos where o_id = '".$_GET['pid']."'");
                        while ($pRow = mysql_fetch_array($photos)){
                            echo "<li id=\"clickPoza".$x."\"><div class=\"WBimg\" onMouseOver=\"this.className='WBimg_over';\"  onMouseOut=\"this.className='WBimg';\" style=\"background-image:url(../../../uploads/offers/img/".cleanitup($row["o_title"])."/thumbs/thumb-60_".$pRow["oImg_file"].");\">&nbsp;</div></li>";
                            $x++;
                        }
                        echo '</ul>';
                        echo '</div>';
                        //<!-- end thumbs slider -->
                        echo '</div>';
                        echo '</div>';
                    }
                    elseif ($row['head_type'] == 'video'){?>
        <div class="text_video_holder">
            <div class="text_video_left">
                <script language="javascript">
                    if (AC_FL_RunContent == 0) {
                            alert("This page requires AC_RunActiveContent.js.");
                    } else {
                            AC_FL_RunContent(
                                    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                                    'width', '400',
                                    'height', '285',
                                    'src', 'jcplayer',
                                    'quality', 'high',
                                    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                                    'align', 'middle',
                                    'play', 'true',
                                    'loop', 'true',
                                    'scale', 'noScale',
                                    'wmode', 'window',
                                    'devicefont', 'false',
                                    'id', 'jcplayer',
                                    'bgcolor', '#ffffff',
                                    'wmode', 'transparent',
                                    'name', 'jcplayer',
                                    'menu', 'true',
                                    'allowFullScreen', 'true',
                                    'allowScriptAccess','sameDomain',
                                    <?php
                                        $videos = mysql_query("select * from dt_offers_video where o_id = '".$_GET['pid']."'");
                                        $vRow = mysql_fetch_array($videos);
                                        $string = 'uploads/offers/video/'.cleanitup($row['o_title']).'/'.$vRow['oVid_file'];
                                        $photo = '../../../uploads/offers/video/'.cleanitup($row['o_title']).'/'.$vRow['oVid_pic'];
                                    ?>
                                    'FlashVars','videoURL=<?php echo $string;?>&autoPlay=false&startPhotoSource=<?php echo $photo;?>&backgroundColor1=0x333333&backgroundColor2=0x222222',
                                    'movie', '../../../jcplayer',
                                    'salign','TL'
                                    ); //end AC code
                    }
                </script>
                <noscript>
                    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="320" height="265" id="jcplayer" align="TL">
                    <param name="allowScriptAccess" value="sameDomain" />
                    <param name="FlashVars" value="videoURL=uploads/offers/video/oferta_1/video.flv&autoPlay=false&startPhotoSource=uploads/offers/video/oferta_1/thumbs/photo.jpg&backgroundColor1=0x333333&backgroundColor2=0x222222">
                    <param name="allowFullScreen" value="true" />
                    <param name="salign" value="TL" />
                    <param name="scale" value="noScale" />
                    <param name="movie" value="jcplayer.swf" />
                    <param name="quality" value="high" />
                    <param name="bgcolor" value="#ffffff" />
                    <embed src="jcplayer.swf" FlashVars="videoURL=uploads/offers/video/oferta_1/video.flv&autoPlay=false&startPhotoSource=uploads/offers/video/oferta_1/thumbs/photo.jpg&backgroundColor1=0x333333&backgroundColor2=0x222222" quality="high" bgcolor="#ffffff" width="320" height="265" name="jcplayer" align="middle" salign="TL" scale="noScale" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
                    </object>
                </noscript>
                </div>
            <div class="text_video_right">
                <?php
                $selectQuery = mysql_query("select * from dt_offers where o_id = '".$_GET['pid']."'");
                $sRow = mysql_fetch_array($selectQuery);
                ?>
                <div class="TVR_title"><?php echo $sRow['o_title'] ?> <b><?php echo $sRow['o_label']?></b></div>
                <div class="TVR_text">
                    <?php echo limitclear($sRow['o_content'], 300).'...';?>
                </div>
            </div>
        </div>
                    <?php }}?>
    </div>
</div>